// 拦截器引入
import request from "../util/request"

//添加广告请求
export const addAdvRequest = (myForm)=>{
    return request.post("/addAdv", myForm)
}

//查询所有的广告
export const advListRequest = (pageNo = 3,everyNum = 3)=>{
    // console.log(pageNo);
    return request.get(`/advList/${pageNo}/${everyNum}`)
}

//删除广告 delete默认query传参
export const deleteAdvRequest = (_id)=>{
    return request.delete("/deleteAdv",{
        params: {
            _id
          }  
    })
}

// 查询更新在弹框上的广告数据
export const getUpdateAdvRequest = (_id)=>{
    return request.get("/getUpdateAdv",{
        params: {
            _id
          }  
    })
}

// 查询更新在弹框上的广告数据
export const updateAdvRequest = (formData,_id)=>{
    return request.put("/updateAdv",formData,{
        params: {
            _id
          }  
    })
}